<?php
	include_once "db_connect.php";

	// 쿼리문 작성
	$sql  = " SELECT ";
	$sql .= "       B.idx ";
	$sql .= "     , B.category ";
	$sql .= "     , B.user_id ";
	$sql .= "     , B.nickname ";
	$sql .= "     , B.service_id ";
	$sql .= "     , B.subject ";
	$sql .= "     , B.content ";
	$sql .= "     , (SELECT CONCAT(file_url,raw_name,'_SIZE',file_ext) thumb_url FROM tb_bbs_file  WHERE idx = B.idx LIMIT 1) thumb_url ";
	$sql .= " FROM  tb_bbs B ";
	$sql .= " WHERE B.category = 'starpt' ";
	$sql .= " AND   B.notice_yn = 'N' ";
	$sql .= " ORDER BY B.create_dt DESC ";
	$sql .= " LIMIT 0, 9 ";
	
	$result_list = query_to_array($sql);
?>
				<div class="sub_star_pt">
					<h3><Img src="/images/main/tit_star_pt.gif" alt="스타사진 운세" /></h3>
					<span class="more"><a href="/bbs/starpt">더보기</a></span>
					<ul>
<?	foreach ($result_list as $item) : ?>
						<li><a href="/bbs/starpt/read?idx=<?=$item['idx']?>"><img src="<?=str_replace('_SIZE', '_143', $item['thumb_url'])?>" width="79" height="60" /></a></li>
<?	endforeach ?>
					</ul>
				</div>
